package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo10 {

    public static void main(String[] args) throws Exception {
        Class cls = Class .forName("reflect.Person");

        Method method = cls.getMethod("sayHello");
        Boolean mark1 = method.isAnnotationPresent(AutoRunMethod.class);
        System.out.println("sayHello方法上是否有@AutoRunMethod:"+mark1);

        Method method2 = cls.getMethod("sleep");
        boolean mark2 = method2.isAnnotationPresent(AutoRunMethod.class);
        System.out.println("sleep方法上是否有@AutoRunMethod:"+mark2);



    }
}
